<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>
</head>
<body>

    {% if message %}
        <p>{{ message }}</p>
    {% endif %}
    
    {% for category, message in get_flashed_messages(with_categories=true) %}
        <spam class="{{ category }}">{{ message }}</spam>
    {% endfor %}

    <form action="" method="post">
        {{ form.csrf_token }}
        <p>
            {{ form.username.label() }}
            {{ form.username() }}
            {% if form.username.errors %}
                {% for error in form.username.errors %}
                    {{ error }}
                {% endfor %}
            {% endif %}
        </p>
        <p>
            {{ form.password.label() }}
            {{ form.password() }}
            {% if form.password.errors %}
                {% for error in form.password.errors %}
                    {{ error }}
                {% endfor %}
            {% endif %}
        </p>
        <p>
            {{ form.remember.label() }}
            {{ form.remember() }}
        </p>
        <p>
            {{ form.submit() }}
        </p>
    </form>

</body>
</html>